﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using SVC.client;
namespace UI.Forms
{
    public partial class zftype : FormBase1
    {
        //private SVC.client.shop cur = null;
        public zftype()
        {
            InitializeComponent();
        }

        private void btn_new_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            收付款方式_N frm = new 收付款方式_N();
            frm.FatherRefresh = bind;
            frm.ShowDialog();
        }

        private void btn_update_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (gridView1.FocusedRowHandle < 0) return;
            SVC.client.ZFTYPE zt = gridView1.GetRow(gridView1.FocusedRowHandle) as SVC.client.ZFTYPE;
            收付款方式_U frm = new 收付款方式_U(zt);
            frm.FatherRefresh = bind;
            frm.Show();

        }

        private void btn_delete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (gridView1.FocusedRowHandle < 0) return;
            SVC.client.ZFTYPE zt = gridView1.GetRow(gridView1.FocusedRowHandle) as SVC.client.ZFTYPE;
            string r = my.bw.ZFTYPEByzftypeid_Delete(zt.zftypeid, my.ACID);
            if (string.IsNullOrEmpty(r))
            {
                bind();
            }
            else
            {
                Comm.ShowErorr(r);
            }
        }

        private void shop_Load(object sender, EventArgs e)
        {
            bind();
        }

        private void bind()
        {
            gridControl1.DataSource = my.bw.ZFTYPE_Get("", my.ACID);
        }

 

        private void btn_sx_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {

            bind();
        }
    }
}